package com.atm.bulksms.data;

import com.atm.bulksms.R;
import com.atm.bulksms.util.Utils;

import android.content.Context;
import android.database.Cursor;
import android.provider.ContactsContract;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckedTextView;
import android.widget.CursorAdapter;
import android.widget.LinearLayout;
import android.widget.SimpleCursorAdapter;

public class InboxAdapter extends SimpleCursorAdapter{

	LayoutInflater inflater;
	public InboxAdapter(Context context, int layout, Cursor c, String[] from,
			int[] to) {
		super(context, layout, c, from, to);
		inflater = LayoutInflater.from(context);
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		LinearLayout layout = (LinearLayout)inflater.inflate(R.layout.inbox_item, null);
		Cursor c = (Cursor)getItem(position);
		/*checkedView.setText(c.getString(c.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)));
		if(Utils.hasContact(c.getInt(c.getColumnIndex(ContactsContract.Contacts._ID)))){
			//checkedView.setChecked(true);
			checkedView.setCheckMarkDrawable(android.R.drawable.star_on);
		}else{
			//checkedView.setChecked(false);
			checkedView.setCheckMarkDrawable(android.R.drawable.star_off);
		}*/
		convertView = layout;
		return convertView;
	}
	
}
